// 环境相关的机构配置

// 定义机构接口（避免循环导入）
export interface Organization {
  name: string;
  account: string;
  password: string;
  menuPermissions?: string;
}

// 开发环境机构配置
export const devOrganizations: Organization[] = [
  { name: '开发测试机构1', account: 'dev1', password: 'dev123' },
  { name: '开发测试机构2', account: 'dev2', password: 'dev123' },
  { name: '创盛(开发)', account: 'jinanchuangsheng', password: 'pt2021' },
  { name: '德睿(开发)', account: 'derui', password: 'pt2021' },
];

// 测试环境机构配置
export const testOrganizations: Organization[] = [
  { name: '测试机构1', account: 'test1', password: 'test123' },
  { name: '测试机构2', account: 'test2', password: 'test123' },
  { name: '创盛(测试)', account: 'jinanchuangsheng', password: 'pt2021' },
  { name: '德睿(测试)', account: 'derui', password: 'pt2021' },
];

// 生产环境机构配置（完整列表）
export const prodOrganizations: Organization[] = [
  { name: '创盛', account: 'jinanchuangsheng', password: 'pt2021' },
  { name: '德睿', account: 'derui', password: 'pt2021' },
  { name: '光禾汇金', account: 'guanghehuijin', password: 'pt2021' },
  { name: '好瑞迪', account: 'haoruidi', password: 'pt2021' },
  { name: '恒银', account: 'hengyin', password: 'pt2021' },
  { name: '恒运', account: 'hengyun', password: 'pt2021' },
  { name: '恒运中信', account: 'zhongxin', password: 'pt2021' },
  { name: '联信', account: 'lianxin', password: 'pt2021' },
  { name: '迈鸿', account: 'maihong', password: 'pt2021' },
  { name: '启联', account: 'qilian', password: 'pt2021' },
  { name: '儒晓/钦州儒晓', account: 'ruxiao', password: 'pt2021' },
  { name: '天目', account: 'tianmu', password: 'pt2021' },
  { name: '新奔腾', account: 'xinbenteng', password: 'pt2021' },
  { name: '新思', account: 'xinsi', password: 'pt2021' },
  { name: '优信', account: 'youxin', password: 'pt2021' },
  { name: '元鑫', account: 'yuanxin', password: 'pt2021' },
  { name: '赟途南宁', account: 'yuntunanning', password: 'pt2021' },
  { name: '赟途钦州', account: 'yuntuqinzhou', password: 'pt2021' },
  { name: '泽尚融', account: 'zeshangrong1', password: 'pt2021' },
  { name: '臻隆', account: 'zhenlong', password: 'pt2021' },
  { name: '正立', account: 'zhengli', password: 'pt2021' },
  { name: '中源恒富', account: 'zhongyuanhengfu', password: 'pt2021' },
  { name: '广西儒晓', account: 'ruxiaoguangxi', password: 'pt2021' },
  { name: '善阳', account: 'shanyang', password: 'pt2021' },
  { name: '信用卡调解(调解平台)', account: 'caimeng', password: 'Caimeng1013' },
  { name: '法易调解', account: 'caimengmeng', password: 'Caimeng1013' },
];

// 根据环境获取机构配置
export function getOrganizationsByEnv(env: string = 'production'): Organization[] {
  switch (env) {
    case 'development':
      return devOrganizations;
    case 'test':
      return testOrganizations;
    case 'production':
    default:
      return prodOrganizations;
  }
}

// 获取当前环境的机构配置
export function getCurrentOrganizations(): Organization[] {
  const env = import.meta.env.MODE || 'production';
  return getOrganizationsByEnv(env);
}
